package com.ruoyi.ax.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ax.mapper.AxMemberLevelMapper;
import com.ruoyi.ax.domain.AxMemberLevel;
import com.ruoyi.ax.service.IAxMemberLevelService;

/**
 * 会员等级Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-19
 */
@Service
public class AxMemberLevelServiceImpl implements IAxMemberLevelService 
{
    @Autowired
    private AxMemberLevelMapper axMemberLevelMapper;

    /**
     * 查询会员等级
     * 
     * @param id 会员等级主键
     * @return 会员等级
     */
    @Override
    public AxMemberLevel selectAxMemberLevelById(Long id)
    {
        return axMemberLevelMapper.selectAxMemberLevelById(id);
    }

    /**
     * 查询会员等级列表
     * 
     * @param axMemberLevel 会员等级
     * @return 会员等级
     */
    @Override
    public List<AxMemberLevel> selectAxMemberLevelList(AxMemberLevel axMemberLevel)
    {
        return axMemberLevelMapper.selectAxMemberLevelList(axMemberLevel);
    }

    /**
     * 新增会员等级
     * 
     * @param axMemberLevel 会员等级
     * @return 结果
     */
    @Override
    public int insertAxMemberLevel(AxMemberLevel axMemberLevel)
    {
        axMemberLevel.setCreateTime(DateUtils.getNowDate());
        return axMemberLevelMapper.insertAxMemberLevel(axMemberLevel);
    }

    /**
     * 修改会员等级
     * 
     * @param axMemberLevel 会员等级
     * @return 结果
     */
    @Override
    public int updateAxMemberLevel(AxMemberLevel axMemberLevel)
    {
        axMemberLevel.setUpdateTime(DateUtils.getNowDate());
        return axMemberLevelMapper.updateAxMemberLevel(axMemberLevel);
    }

    /**
     * 批量删除会员等级
     * 
     * @param ids 需要删除的会员等级主键
     * @return 结果
     */
    @Override
    public int deleteAxMemberLevelByIds(Long[] ids)
    {
        return axMemberLevelMapper.deleteAxMemberLevelByIds(ids);
    }

    /**
     * 删除会员等级信息
     * 
     * @param id 会员等级主键
     * @return 结果
     */
    @Override
    public int deleteAxMemberLevelById(Long id)
    {
        return axMemberLevelMapper.deleteAxMemberLevelById(id);
    }
}
